﻿@model RegisterEditModel
@{
    ViewData["Title"] = new string[] { "关联新邮箱" };
    var codeError = TempData.Get<string>("codeError", string.Empty);
}
<div class="jh-login-home">
    <h1 class="tn-mb-30 tn-space-xlg-hor">关联新帐号</h1>
    @using (Html.BeginForm("AssociateEmail", "Account", FormMethod.Post, new { @id = "RegisterForm", @class = "tn-space-xlg-hor form-horizontal tn-form-validation " }))
            {
        <div class="form-group">
            <label>邮箱地址</label>
            @Html.TextBoxFor(n => n.AccountEmail, new { @class = "form-control" })
            @Html.ValidationMessageFor(n => n.AccountEmail)
            <span class="help-block tn-mb-0">或使用<a href="@SiteUrls.Instance().AssociatePhone()" class="a tn-ml-5">手机注册</a></span>
        </div>
        <div class="form-group " id="passwordLoad"  >
            @Html.Action("_PassWordPoclaimed", "Account", new { passWordTitle = "密码" })
            <span style="top:25px" class="glyphicon  form-control-feedback" aria-hidden="true"><i class="fa fa-eye-slash"></i></span>
            <input class="tn-click-eye" type="button" />
            @Html.ValidationMessageFor(n => n.PassWord)
            <span class="help-block tn-mb-0">字母、数字至少6位</span>
        </div>
        //验证码
        var mathBuildInfoModel = new ViewDataDictionary();
        mathBuildInfoModel.Add("InputText", "换一换");
        mathBuildInfoModel.Add("ErrorMessage", codeError);
        mathBuildInfoModel.Add("RequiredMessage", "请输入正确验证码");
        mathBuildInfoModel.Add("IsRequired", true);
        mathBuildInfoModel.Add("Title", "验证码");
        @Html.Captcha(4, "_DefaultCaptchaView", mathBuildInfoModel).AsIntelligent()
        <div class="form-group">
            <div class="checkbox">
                <label>
                    <input style="margin-top:6px" id="ispass" type="checkbox"><small> 我已看过并完全同意 <a href="javascript:;" class="layerprovision"  class="a tn-ml-5">《用户使用协议》</a> </small>
                </label>
            </div>
        </div>
        <div class="form-group">
            <button type="submit" class="btn btn-primary tn-btn-wm">关联新帐号</button>
        </div>
    }

</div>
<script>
     require(['jquery','tnlayer'],function($,tnlayer){
      $(".layerprovision").click(function(){
            tnlayer.layermodal('注册条款','@CachedUrlHelper.Action("_Provision","Account")','700px','500px')
        }) 
        $(".btn-primary").click(function myfunction() {
            $("#RegisterForm").validate();
            if ($("#RegisterForm").valid()) {
                if (!$("#ispass")[0].checked) {
                    layer.msg("请先阅读用户使用协议", {
                        icon: 2
                    });
                    return false;
                }
            }
        })
     })
</script>